package cn.edu.scau.cmi.mengzhuorong.client;

import java.util.Scanner;
import cn.edu.scau.cmi.mengzhuorong.abstractFactory.domainAbstractClass.*;
import cn.edu.scau.cmi.mengzhuorong.abstractFactory.factory.*;
import java.lang.Runnable;

public class AbstractFactoryClient implements Runnable {

	public static void main(String[] args) {
		ConsumerMeatSelect brand;
		Scanner reader = new Scanner(System.in);
		
		System.out.println("有三家企业（Wens、TianBang、Aonong），旗下都有猪肉（Pork）、牛肉（Beef）、鸡肉（Chicken）三个产品");
		System.out.println("请输入企业和产品（如：WensPork）购买：");
		String string = reader.next();
		switch(string) {
		case"WensPork":
			brand = new WensFactory().createPork();
			brand.cook();
			break;
		case"WensBeef":
			brand = new WensFactory().createBeef();
			brand.cook();
			break;
		case"WensChichen":
			brand = new WensFactory().createChicken();
			brand.cook();
			break;
		case"TianBangPork":
			brand = new TianBangFactory().createPork();
			brand.cook();
			break;
		case"TianBangBeef":
			brand = new TianBangFactory().createBeef();
			brand.cook();
			break;
		case"TianBangChicken":
			brand = new TianBangFactory().createChicken();
			brand.cook();
			break;
		case"AonongPork":
			brand = new AonongFactory().createPork();
			brand.cook();
			break;
		case"AonongBeef":
			brand = new AonongFactory().createBeef();
			brand.cook();
			break;
		case"AonongChicken":
			brand = new AonongFactory().createChicken();
			brand.cook();
			break;
			default:
				System.out.println("The imput is wrong!");
		}
		reader.close();
	}
	
	@Override
	public void run() {
		this.main(null);
	}
}
